<template>
	<view class="page">
		<template>
			<view v-for="(item,index) in stepArray" class="listItem">
				<view class="titleLine">
					<view class="stepView" :class="[index<=stepIndex?'active':'']">{{index+1}}</view>
					<view class="titleView" :class="[index<=stepIndex?'active':'']">{{item.title}}</view>
					<view style="color: red;">*</view>
					<view style="flex:1;"></view>
					<icon type="success" color="#248cfa" v-if="item.value!=''"></icon>
				</view>
				<view class="itemContent" :class="[stepIndex==index  ?'currentView':'']" @click="clickItem(index)">
					<view class="leftView" :class="[index<=stepIndex?'active':'']"></view>
					<view class="rightView">

						<!-- <DoctorView :info="info1" v-if="index==0 && JSON.stringify(info1)!='{}'"></DoctorView> -->

						<!-- <view v-else style="display: flex;justify-content: space-between;width: 100%;">
							<view v-if="item.value==''">
								去填写
							</view>
							<view v-else>
								填写值
							</view>
							<image src="../../static/edit.png" style="width: 40rpx;height: 40rpx;"></image>
						</view> -->
						
						
						
						


						<!-- <view v-if="stepIndex==index">
							
						</view>
						<view v-else style="display: flex;justify-content: space-between;width: 100%;">
							<view v-if="item.value==''">
								去填写
							</view>
							<view v-else>
								填写值
							</view>
							<image src="../../static/edit.png" style="width: 40rpx;height: 40rpx;"></image>
						</view> -->

					</view>
				</view>
			</view>
		</template>

		<view style="height: 200rpx;"></view>

		<view class="bottomView">
			<view class="btn">保存</view>
		</view>

		<view class="maskView" v-if="showMask">
			<view class="maskContentView">
				<view class="maskTitleView">
					登记内容
				</view>
				<view class="maskOptionsView">

				</view>
				<view class="maskBottomView">
					<view>取消</view>
					<view>确定</view>
				</view>
			</view>
		</view>


	</view>
</template>

<script>
	import {
		patientArray,
		disArray,
		doctorArray,
		stepArray
	} from './delete.js';
	export default {
		data() {
			return {
				stepArray: [],
				stepIndex: 0,
				showMask: false,
				doctorArray: [],
				doctorDepArray: [],
				disArray: [],
				disDepArray: [],
				patientArray: [],
				info1: {}
			}
		},
		onLoad() {
			let that = this;
			this.patientArray = patientArray;

			disArray.forEach(function(item, index) {
				const depName = item.departmentClassification.replace(' ', '');
				if (that.disDepArray.indexOf(depName) == -1) {
					that.disDepArray.push(depName)
				}
			})
			that.disArray = disArray;

			doctorArray.forEach(function(item, index) {
				const depName = item.departmentName.replace(' ', '');
				if (that.doctorDepArray.indexOf(depName) == -1) {
					that.doctorDepArray.push(depName)
				}
			})
			that.doctorArray = doctorArray;
			that.stepArray = stepArray;

			that.info1 = {
				depArray: that.doctorDepArray,
				docArray: that.doctorArray,
				depIndex: -1,
				docIndex: -1
			}
		},
		methods: {
			clickItem(index) {
				this.stepIndex = index;
			}
		}
	}
</script>

<style lang="scss">
	.page {
		overflow: scroll;
	}


	.currentView {
		height: 500rpx;
	}

	.listItem {

		margin-left: 20rpx;
		margin-right: 20rpx;
		margin-top: 10rpx;

		.titleLine {
			display: flex;
			align-items: center;

			.stepView {
				width: 48rpx;
				height: 48rpx;
				background: #ffffff;
				border-radius: 25rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				color: #888888;
				border: 2rpx solid #888888;
			}

			.stepView.active {
				width: 50rpx;
				height: 50rpx;
				background: darkgoldenrod;
				color: #ffffff;
				border: none;
			}

			.titleView {
				margin-left: 10rpx;
				height: 50rpx;
				display: flex;
				align-items: center;
				border-radius: 8rpx;
				padding: 4rpx 10rpx;
				color: #888888;
				font-size: 34rpx;
				font-weight: bold;
			}

			.titleView.active {
				color: darkgoldenrod;
			}
		}

		.itemContent {
			display: flex;
			margin-top: 10rpx;


			.leftView {
				width: 4rpx;
				height: auto;
				margin-left: 23rpx;
				margin-right: 23rpx;
				background-color: #888888;
			}

			.leftView.active {
				background-color: darkgoldenrod;
			}

			.rightView {
				flex: 1;
				margin-left: 10rpx;
				border-radius: 10rpx;
				height: 100%;
				width: 100%;
				box-shadow: 0 2rpx 8rpx rgba(204, 204, 204, 0.2);
				background-color: #cccccc;

				.view1 {
					flex: 1;
				}

				.iconView {
					display: flex;
					align-items: center;
					margin-left: 20rpx;
				}
			}

			.rightView.active {}
		}
	}

	.bottomView {
		padding-bottom: 30rpx;
		position: fixed;
		bottom: 0rpx;
		left: 0rpx;
		right: 0rpx;
		padding-top: 20rpx;
		background-color: #cccccc;

		.btn {
			height: 80rpx;
			background-color: #248cfa;
			color: #ffffff;
			margin-left: 50rpx;
			margin-right: 50rpx;
			text-align: center;
			border-radius: 20rpx;
			font-size: 34rpx;
			line-height: 80rpx;
			font-weight: bold;
		}

	}

	.maskView {
		position: fixed;
		top: 0rpx;
		left: 0rpx;
		right: 0rpx;
		bottom: 0rpx;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		justify-content: center;

		.maskContentView {
			width: 90%;
			background-color: #ffffff;
			padding: 20rpx;
			border-radius: 20rpx;
			height: 60%;
			margin-top: 15%;
			display: flex;
			flex-direction: column;


			.maskTitleView {
				font-size: 40rpx;
				font-weight: bold;
			}

			.maskOptionsView {
				flex: 1;
			}

			.maskBottomView {
				height: 80rpx;
				// background-color: rebeccapurple;
				display: flex;
				justify-content: center;

				&>view {
					width: 260rpx;
					background-color: #248cfa;
					height: 80rpx;
					border-radius: 40rpx;
					display: flex;
					justify-content: center;
					align-items: center;
					color: #ffffff;
					font-size: 34rpx;
					margin-left: 10rpx;
					margin-right: 10rpx;
				}
			}
		}

	}
</style>